/* ComfyUI Queue Manager Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
}

#queue-manager-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

header h1 {
    color: #4CAF50;
    font-size: 2rem;
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-warning {
    background-color: #ff9800;
    color: white;
}

.btn-warning:hover {
    background-color: #e68900;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #da190b;
}

.queue-container {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.queue-header h2 {
    color: #ffffff;
}

.queue-actions {
    display: flex;
    gap: 10px;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #333;
    border-radius: 4px;
}

#search-input, #status-filter {
    padding: 8px 12px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #444;
    color: #ffffff;
    font-size: 14px;
}

#search-input {
    flex: 1;
    min-width: 200px;
}

#status-filter {
    min-width: 150px;
}

.queue-items {
    min-height: 400px;
}

.queue-item {
    background-color: #333;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #666;
    transition: background-color 0.3s;
}

.queue-item:hover {
    background-color: #3a3a3a;
}

.queue-item.pending {
    border-left-color: #2196F3;
}

.queue-item.running {
    border-left-color: #ff9800;
}

.queue-item.completed {
    border-left-color: #4CAF50;
}

.queue-item.failed {
    border-left-color: #f44336;
}

.queue-item.archived {
    border-left-color: #9E9E9E;
    opacity: 0.7;
}

.queue-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.queue-item-title {
    font-weight: bold;
    font-size: 16px;
}

.queue-item-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: bold;
}

.status-pending {
    background-color: #2196F3;
    color: white;
}

.status-running {
    background-color: #ff9800;
    color: white;
}

.status-completed {
    background-color: #4CAF50;
    color: white;
}

.status-failed {
    background-color: #f44336;
    color: white;
}

.status-archived {
    background-color: #9E9E9E;
    color: white;
}

.queue-item-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 10px;
}

.queue-item-actions {
    display: flex;
    gap: 10px;
}

.queue-item-actions .btn {
    font-size: 12px;
    padding: 4px 8px;
}

.queue-item-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.queue-item-details {
    margin-top: 15px;
    padding: 10px;
    background-color: #222;
    border-radius: 4px;
    border: 1px solid #444;
}

.queue-item-details h4 {
    margin-bottom: 10px;
    color: #4CAF50;
    font-size: 14px;
}

.queue-item-details pre {
    background-color: #1a1a1a;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
}

.item-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-header-right {
    display: flex;
    align-items: center;
}

.queue-item.selected {
    background-color: #3a4a3a;
    border-left-color: #4CAF50;
}

.queue-item:hover {
    cursor: pointer;
}

.filtered-empty-state {
    margin-top: 20px;
}

/* Status indicator */
.status-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

.status-success {
    background-color: #4CAF50;
}

.status-warning {
    background-color: #ff9800;
}

.status-error {
    background-color: #f44336;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced button states */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #666 !important;
}

.btn:disabled:hover {
    background-color: #666 !important;
}

/* Queue state indicator in header */
header {
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #4CAF50, transparent);
    transition: background 0.3s ease;
}

header.paused::after {
    background: linear-gradient(90deg, #ff9800, transparent);
}

/* Help modal styles */
.help-shortcuts {
    margin-bottom: 20px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.shortcut-item:last-child {
    border-bottom: none;
}

kbd {
    background-color: #444;
    border: 1px solid #666;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 12px;
    color: #fff;
}

.help-features {
    list-style: none;
    padding: 0;
}

.help-features li {
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.help-features li:last-child {
    border-bottom: none;
}

.help-features strong {
    color: #4CAF50;
}

.checkbox {
    margin-right: 10px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: #2a2a2a;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.modal-header h3 {
    margin: 0;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 20px;
}

.modal-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
}

.tab-btn {
    background: none;
    border: none;
    color: #aaa;
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
}

.tab-btn:hover {
    color: #ffffff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    cursor: pointer;
}

.form-group input[type="checkbox"] {
    margin: 0;
}

.file-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #444;
    color: #ffffff;
    font-size: 14px;
}

.file-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Error message styles */
.error-message {
    background-color: #f44336;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

/* Success message styles */
.success-message {
    background-color: #4CAF50;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

/* Loading spinner */
.spinner {
    border: 2px solid #333;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Improved responsive design */
@media (max-width: 768px) {
    #queue-manager-app {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    header h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .queue-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .queue-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .queue-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .queue-item-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .queue-item-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .modal {
        width: 95%;
        margin: 10px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .queue-container {
        padding: 15px;
    }
    
    .queue-item {
        padding: 12px;
    }
    
    .queue-item-title {
        font-size: 14px;
    }
    
    .controls {
        gap: 5px;
    }
    
    .queue-actions {
        gap: 5px;
    }
}